#include "FrameTimeController.h"

//Constructor
FrameTimeController::FrameTimeController()
:m_numberOfFramePerSecond(0), m_currentTime(0), m_first(true), m_firstFrameID(0)
{}

//Destructor
FrameTimeController::~FrameTimeController(){}

//update the controller
void FrameTimeController::doUpdate()
{
	float timeBetweenFrame = 1000.f / m_numberOfFramePerSecond;

	if(m_first)
	{
		m_first = false;
		m_currentTime = timeBetweenFrame * m_firstFrameID;
		setValue(m_currentTime);
		return;
	}

	
	m_currentTime += timeBetweenFrame;
	setValue(m_currentTime);
}